﻿<local:KinectButtonBase x:Class="Kinect.Tests.KinectButton"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Kinect.Tests"
             mc:Ignorable="d" 
             Margin="0,0,10,10">
    <local:KinectButtonBase.Template>
        <ControlTemplate TargetType="{x:Type local:KinectButtonBase}">
            <Grid x:Name="Root" RenderTransformOrigin="0.5,0.5">
                <Grid.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform />
                        <SkewTransform />
                        <RotateTransform />
                        <TranslateTransform />
                    </TransformGroup>
                </Grid.RenderTransform>
                <Rectangle x:Name="ButtonBackground" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" />
                <ContentPresenter />
                <TextBlock Visibility="{Binding SmallText}" Text="{TemplateBinding Tag}" Style="{StaticResource ToolLabelStyle}" TextWrapping="WrapWithOverflow"  />
                <TextBlock Visibility="{Binding LargeText}" Text="{TemplateBinding Tag}" Style="{StaticResource ToolLabelStyleLarge}" TextWrapping="WrapWithOverflow"  />
            </Grid>

            <ControlTemplate.Triggers>
                <Trigger Property="IsPressed" Value="True">
                    <Setter Property="RenderTransform" TargetName="Root">
                        <Setter.Value>
                            <ScaleTransform ScaleX="0.9" ScaleY="0.9" />
                        </Setter.Value>
                    </Setter>
                </Trigger>
            </ControlTemplate.Triggers>

        </ControlTemplate>
    </local:KinectButtonBase.Template>
</local:KinectButtonBase>
